home *** CD-ROM | disk | FTP | other *** search
/ Enter 2006 September / Enter 09 2006.iso / Internet / SpamExperts Home 1.1 / SpamExperts Home.exe / lib / spamexperts.modules / spamexperts / se_stats.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2006-07-14  |  4.4 KB  |  55 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. '''se_stats.py - SpamExperts statistics class.
  5. '''
  6. __author__ = 'Tony Meyer <ta-meyer@ihug.co.nz>'
  7. from spambayes import Stats
  8.  
  9. try:
  10.     _
  11. except NameError:
  12.     
  13.     _ = lambda arg: arg
  14.  
  15.  
  16. class SEStats(Stats.Stats):
  17.     
  18.     def GetStats(self, decimal_points = 1):
  19.         data = self._CombineSessionAndTotal()
  20.         yield (_('Messages classified:\t%d') % (data['num_seen'],), _('This is the total number of email messages that SpamExperts has been classified.'))
  21.         if data['num_seen'] == 0:
  22.             return None
  23.         
  24.         data = self._CalculateAdditional(data)
  25.         format_dict = self._AddPercentStrings(data, decimal_points)
  26.         format_dict['tab'] = '\t'
  27.         yield (_('Not Spam:%(tab)s%(num_ham)d (%(perc_ham_s)s)') % format_dict % format_dict, _('This is the number of email messages that SpamExperts classified as Not Spam.'))
  28.         yield (_('Unsure:%(tab)s%(num_unsure)d (%(perc_unsure_s)s)') % format_dict % format_dict, _('This is the number of email messages that SpamExperts was unable to classify.'))
  29.         yield (_('Spam:%(tab)s%(num_spam)d (%(perc_spam_s)s)') % format_dict % format_dict, _('This is the number of email messages that SpamExperts classified as Spam.'))
  30.         yield ('', '')
  31.         yield (_('Classified correctly:%(tab)s%(num_correct)d (%(perc_correct_s)s of total)') % format_dict % format_dict, _('This is the number of email messages that SpamExperts has correctly classified (this does not include any messages classified as Unsure).'))
  32.         yield (_('Classified incorrectly:%(tab)s%(num_incorrect)d (%(perc_incorrect_s)s of total)') % format_dict % format_dict, _('This is the number of email messages that SpamExperts has incorrectly classified (this does not include any messages classified as Unsure).'))
  33.         if format_dict['num_incorrect']:
  34.             yield (_('False positives:%(tab)s%(num_trained_ham_fp)d (%(perc_fp_s)s of total)') % format_dict % format_dict, _('This is the number of Not Spam email messages that SpamExperts has classified as Spam.'))
  35.             yield (_('False negatives:%(tab)s%(num_trained_spam_fn)d (%(perc_fn_s)s of total)') % format_dict % format_dict, _('This is the number of Spam email messages that SpamExperts has classified as Not Spam.'))
  36.         
  37.         yield ('', '')
  38.         yield (_('Manually classified as Not Spam:%(tab)s%(num_trained_ham)d') % format_dict, _('This is the number of messages that you have trained as Not Spam. This does not include messages automatically trained by SpamExperts.'))
  39.         yield (_('Manually classified as Spam:%(tab)s%(num_trained_spam)d') % format_dict, _('This is the number of messages that you have trained as Spam. This does not include messages automatically trained by SpamExperts.'))
  40.         yield ('', '')
  41.         if format_dict['num_unsure']:
  42.             yield (_('Unsures trained as Not Spam:%(tab)s%(num_unsure_trained_ham)d (%(perc_unsure_trained_ham_s)s of Unsures)') % format_dict % format_dict, _("This is the number of messages that SpamExperts wasn't able to classify, which you have trained as Not Spam."))
  43.             yield (_('Unsures trained as Spam:%(tab)s%(num_unsure_trained_spam)d (%(perc_unsure_trained_spam_s)s of unsures)') % format_dict % format_dict, _("This is the number of messages that SpamExperts wasn't able to classify, which you have trained as Spam."))
  44.             yield (_('Unsures not trained:%(tab)s%(num_unsure_not_trained)d (%(perc_unsure_not_trained_s)s of Unsures)') % format_dict % format_dict, _("This is the number of messages that SpamExperts wasn't able to classify, which you have not trained.  You should always try and classify all messages that SpamExperts is unable to classify so that it can do better in the future."))
  45.             yield ('', '')
  46.         
  47.         if format_dict['total_spam']:
  48.             yield (_('Spam correctly identified:%(tab)s%(perc_spam_correct_s)s (+ %(perc_spam_unsure_s)s Unsure)') % format_dict % format_dict, _('This is the number of Spam email messages that SpamExperts correctly classified.'))
  49.         
  50.         if format_dict['total_ham']:
  51.             yield (_('Not Spam incorrectly identified:%(tab)s%(perc_ham_incorrect_s)s (+ %(perc_ham_unsure_s)s Unsure)') % format_dict % format_dict, _('This is the number of Not Spam email messages that SpamExperts has classified incorrectly.'))
  52.         
  53.  
  54.  
  55.